package com.music.wangyi.Base

import android.view.View
import androidx.lifecycle.ViewModel
import androidx.navigation.NavOptions
import androidx.navigation.findNavController
import com.music.wangyi.R

open class BaseViewModel: ViewModel() {
    // 共享跳转方法
    fun navigate(view: View, resId:Int){
        val navOptions = NavOptions.Builder()
            .setPopEnterAnim(R.anim.anim_enter)
            .setPopExitAnim(R.anim.anim_exit)
            .setEnterAnim(R.anim.anim_enter)
            .setExitAnim(R.anim.anim_exit)
            .build()
        view.findNavController().navigate(resId,null,navOptions)
    }
}